<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNewsClassTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('news_class', function (Blueprint $table) {
            $table->id();
            $table->string('class_name', 50)->comment('分类名');
            $table->string('class_img', 255)->comment('分类图标');
            $table->unsignedInteger('p_class_id')->nullable()->comment('父类目 ID');
            $table->unsignedInteger('p_id')->nullable()->comment('父id');
            $table->tinyInteger('sort')->default(0)->comment('排序');
            $table->tinyInteger('status')->default(0)->comment('状态 0-下线 1-上线');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('news_class');
    }
}
